<!--
// +----------------------------------------------------------------------
// | Created by PHPstorm: JRKAdmin框架 [ JRKAdmin ]
// +----------------------------------------------------------------------
// | Copyright (c) 2019~2022 [LuckyHHY] All rights reserved.
// +----------------------------------------------------------------------
// | SiteUrl: http://www.luckyhhy.cn
// +----------------------------------------------------------------------
// | Author: LuckyHhy <jackhhy520@qq.com>
// +----------------------------------------------------------------------
// | Date: 2020/3/4-16:38
// +----------------------------------------------------------------------
// | Description:
// +----------------------------------------------------------------------
*-->

{extend name='public/window' /}


{block name="content"}

<div class="layui-fluid">
    <div class="layui-card">

        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form">

                        {:token()}

                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">模型名称：</label>
                            <div class="layui-input-block input-custom-width">
                                <input type="text" name="name" value="{$info.name}" placeholder="请输入模型名称" lay-verify="required" lay-vertype="tips"  lay-reqtext="请输入模型名称" autocomplete="off" class="layui-input ">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">排序</label>
                            <div class="layui-input-inline input-custom-width">
                                <input type="number" name="sort" required autocomplete="off" class="layui-input" value="{$info.sort}">
                            </div>
                            <div class="layui-form-mid layui-word-aux">值越大越靠前</div>
                        </div>

                          <input type="hidden" name="id" value="{$info.id}" >
                        <div class="layui-form-item">
                            <label class="layui-form-label">封面页模版</label>
                            <div class="layui-input-block input-custom-width">
                                <input type="text" name="index_template"  placeholder="请输入封面页模版" autocomplete="off" class="layui-input" value="{$info.index_template|default='index'}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">列表页模版</label>
                            <div class="layui-input-block input-custom-width">
                                <input type="text" name="list_template"  placeholder="请输入列表页模版" autocomplete="off" class="layui-input" value="{$info.index_template|default='lists'}">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">详情页模版</label>
                            <div class="layui-input-block input-custom-width">
                                <input type="text" name="show_template"  placeholder="请输入详情页模版" autocomplete="off" class="layui-input" value="{$info.index_template|default='show'}">
                            </div>
                        </div>


                         {:widget('common/forms/submit',array('add','立即提交',2))}

        </form>

    </div>
</div>
</div>



<script>
    layui.use(['element', 'form', 'jquery','lucky'], function () {
        var element = layui.element;
        var table = layui.table;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;

        form.on('submit(add)', function (data) {
            lucky.FormSubmit("{:url('model/addModel')}",data.field,"table_id",1);
            return false;
        });

    })

</script>

{/block}

